package com.icexxx.ice_browser2;

import java.util.List;

import com.icexxx.ice_browser.DataCenter;
import com.icexxx.ice_browser.Request;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil;

public class Main {

    public static void main(String[] args) {
        String savePath = "C:\\ice-browser";
        String savePathFull = savePath + "/json.txt";
        byte[] readBytes = FileUtil.readBytes(savePathFull);
        Object unserialize = ObjectUtil.deserialize(readBytes);
        if (unserialize instanceof List) {
            @SuppressWarnings("unchecked")
            List<Request> all = (List<Request>) unserialize;
            DataCenter.addAll(all);
            List<Request> all2 = DataCenter.getAll();
            for (Request request : all2) {
                System.out.println(request);
            }
            System.out.println(all2.size());
        }
    }

}
